clc; clear; close all;
run10ari=[ 5.0000    0.7090    9.9929
    6.0000    0.3980   20.1750
    7.0000    0.2290   36.7897
    8.0000    0.1431   15.1101
    9.0000    0.0692    9.7006
   10.0000    0.1229    5.1560
   11.0000    0.0650   23.4295
   12.0000    0.0917    2.7607
   13.0000    0.0840   13.4081
   14.0000    0.1648   13.1785
   15.0000    0.1309    3.6095
   16.0000    0.1006    1.5963
   17.0000    0.1300    1.0442
   18.0000    0.1422    4.4378
   19.0000    0.0986    1.4574
   20.0000    0.1158    1.2452
   21.0000    0.0973    2.2593
   22.0000    0.1010    2.7376
   23.0000    0.1041    2.0252
   24.0000    0.1035    6.9122
   25.0000    0.1108    8.5800
   26.0000    0.0842    8.9320
   27.0000    0.0997    7.5217
   28.0000    0.0538    2.9462
   29.0000    0.1320    4.6177];
run10ari(run10ari==0)=NaN;


run10xyi=[ 5.0000e+00   2.0598e+02   1.8384e+02
   6.0000e+00   1.0770e+02   1.0194e+02
   7.0000e+00   6.8635e+01   5.5354e+01
   8.0000e+00   3.2907e+01   4.5869e+01
   9.0000e+00   1.0747e+01   2.6015e+01
   1.0000e+01   2.3963e+01   3.9103e+01
   1.1000e+01   1.7208e+01   2.9413e+01
   1.2000e+01   1.6762e+01   2.9387e+01
   1.3000e+01   2.3099e+01   2.4915e+01
   1.4000e+01   4.4359e+01   4.2552e+01
   1.5000e+01   2.8380e+01   3.6919e+01
   1.6000e+01   2.4960e+01   2.5740e+01
   1.7000e+01   2.8178e+01   3.6261e+01
   1.8000e+01   3.4989e+01   3.6145e+01
   1.9000e+01   2.6234e+01   2.3069e+01
   2.0000e+01   3.0859e+01   2.7071e+01
   2.1000e+01   2.9032e+01   1.9403e+01
   2.2000e+01   3.1263e+01   1.9074e+01
   2.3000e+01   3.0506e+01   2.2735e+01
   2.4000e+01   3.6135e+01   1.4466e+01
   2.5000e+01   3.6193e+01   2.2251e+01
   2.6000e+01   2.8363e+01   1.7202e+01
   2.7000e+01   3.8747e+01   6.6813e+00
   2.8000e+01   1.9634e+01   8.9399e+00
   2.9000e+01   5.0356e+01   1.6249e+01];
run10xyi(run10xyi==0)=NaN;


run10xyvi=[ 6.0000e+00   1.0449e+02   1.8446e+02
   7.0000e+00   6.1415e+01   1.9377e+02
   8.0000e+00   5.3078e+01   5.7045e+01
   9.0000e+00   3.1227e+01   4.9834e+01
   1.0000e+01   2.4749e+01   4.0692e+01
   1.1000e+01   4.2484e+01   8.7161e+01
   1.2000e+01   4.6494e+01   7.5439e+01
   1.3000e+01   2.2027e+01   3.4087e+01
   1.4000e+01   3.8620e+01   3.3192e+01
   1.5000e+01   3.8947e+01   4.3826e+01
   1.6000e+01   6.7194e+01   7.2415e+01
   1.7000e+01   3.5599e+01   4.2937e+01
   1.8000e+01   3.4211e+01   3.6680e+01
   1.9000e+01   2.0491e+01   1.8489e+01
   2.0000e+01   2.5723e+01   2.3621e+01
   2.1000e+01   2.4624e+01   2.0339e+01
   2.2000e+01   2.9842e+01   1.9723e+01
   2.3000e+01   2.7646e+01   1.8712e+01
   2.4000e+01   2.8919e+01   1.6150e+01
   2.5000e+01   3.4764e+01   1.9272e+01
   2.6000e+01   2.9983e+01   1.5387e+01
   2.7000e+01   2.5079e+01   1.0823e+01
   2.8000e+01   2.7439e+01   6.3721e+00
   2.9000e+01   3.0876e+01   8.4616e+00];
run10xyvi(run10xyvi==0)=NaN;
run10ar=[ 5.0000    0.2490   34.3358
    6.0000    0.1445   10.3380
    7.0000    0.1151    8.6617
    8.0000    0.2260   15.0866
    9.0000    0.2005   14.9017
   10.0000    0.1862   15.7906
   11.0000    0.0538    0.7169
   12.0000    0.3690   20.1222
   13.0000    0.3525   21.3502
   14.0000    0.3860   27.9757
   15.0000    0.1295    3.4640
   16.0000    0.1806    5.0346
   17.0000    0.0810   23.7589
   18.0000    0.0866   24.2122
   19.0000    0.0893   24.4591
   20.0000    0.0743    0.7154
   21.0000    0.1467    5.8844
   22.0000    0.1135    1.4763
   23.0000    0.1446    6.6753
   24.0000    0.1075    6.2138
   25.0000    0.1593    9.5543
   26.0000    0.1205    7.2806
   27.0000    0.1468   11.6496
   28.0000    0.0641    5.5494
   29.0000    0.1248    4.8492];
run10ar(run10ar==0)=NaN;
figure(1)
subplot(2,1,1)
plot(run10ari(:,1),run10ari(:,2),'-xk'),grid;
hold on
plot(run10ar(:,1),run10ar(:,2),'--ok');
legend('IPDA','NN')
ylabel('\theta')
title('RMSE \theta R 10 Runs')
subplot(2,1,2)
plot(run10ari(:,1),run10ari(:,3),'-xk'),grid;
hold on
plot(run10ar(:,1),run10ar(:,3),'--ok');
legend('IPDA','NN')
ylabel('R')
xlabel('Time (k)')

run10xy=[5.0000e+00   7.7611e+01   6.5606e+01
   6.0000e+00   2.4505e+01   5.5880e+01
   7.0000e+00   1.8134e+01   4.3552e+01
   8.0000e+00   4.9108e+01   7.6716e+01
   9.0000e+00   4.8980e+01   6.4880e+01
   1.0000e+01   4.6016e+01   6.0230e+01
   1.1000e+01   1.0093e+01   1.7242e+01
   1.2000e+01   1.0640e+02   9.1184e+01
   1.3000e+01   1.0295e+02   8.6070e+01
   1.4000e+01   1.1289e+02   9.3987e+01
   1.5000e+01   2.7615e+01   3.7741e+01
   1.6000e+01   4.0167e+01   5.0409e+01
   1.7000e+01   2.7997e+01   2.4449e+01
   1.8000e+01   2.7822e+01   2.7441e+01
   1.9000e+01   2.6168e+01   3.0054e+01
   2.0000e+01   1.9956e+01   1.7373e+01
   2.1000e+01   3.6032e+01   3.7521e+01
   2.2000e+01   3.4779e+01   2.1748e+01
   2.3000e+01   4.7357e+01   2.2969e+01
   2.4000e+01   3.6592e+01   1.5540e+01
   2.5000e+01   5.4245e+01   3.3095e+01
   2.6000e+01   3.9243e+01   2.4546e+01
   2.7000e+01   5.0208e+01   2.9482e+01
   2.8000e+01   2.5002e+01   8.7252e+00
   2.9000e+01   4.8358e+01   1.5385e+01];
run10xy(run10xy==0)=NaN;
figure(2)
subplot(2,1,1)
plot(run10xyi(:,1),run10xyi(:,2),'-xk'),grid;
hold on
plot(run10xy(:,1),run10xy(:,2),'--ok');
legend('IPDA','NN')
ylabel('x')
title('RMSE x y 10 Runs')
subplot(2,1,2)
plot(run10xyi(:,1),run10xyi(:,3),'-xk'),grid;
hold on
plot(run10xy(:,1),run10xy(:,3),'--ok');
legend('IPDA','NN')
ylabel('y')
xlabel('Time (k)')

run10xyv=[6.0000e+00   1.1659e+02   2.1204e+02
   7.0000e+00   1.7488e+01   3.6751e+01
   8.0000e+00   3.8060e+01   4.4995e+01
   9.0000e+00   2.6481e+01   6.0670e+01
   1.0000e+01   1.3415e+01   2.8818e+01
   1.1000e+01   3.3814e+01   4.3779e+01
   1.2000e+01   1.3635e+02   4.2900e+01
   1.3000e+01   1.6541e+01   2.8900e+01
   1.4000e+01   4.7678e+01   4.2900e+01
   1.5000e+01   1.3575e+02   4.2169e+01
   1.6000e+01   9.8340e+00   1.3633e+01
   1.7000e+01   8.4589e+01   1.1752e+02
   1.8000e+01   1.6636e+01   1.5245e+01
   1.9000e+01   5.2055e+00   4.1938e+00
   2.0000e+01   7.1642e+01   6.5453e+01
   2.1000e+01   5.1121e+01   5.9695e+01
   2.2000e+01   2.4747e+01   2.1753e+01
   2.3000e+01   2.6295e+01   1.3849e+01
   2.4000e+01   1.6297e+01   9.1222e+00
   2.5000e+01   3.3472e+01   1.8179e+01
   2.6000e+01   1.9504e+01   7.1663e+00
   2.7000e+01   2.7846e+01   9.6522e+00
   2.8000e+01   6.2066e+01   3.6290e+01
   2.9000e+01   2.0565e+01   6.7276e+00];

figure(3)
run10xyv(run10xyv==0)=NaN;
subplot(2,1,1)
plot(run10xyvi(:,1), run10xyvi(:,2),'-xk'),grid;
hold on
plot(run10xyv(:,1), run10xyv(:,2),'--ok');
legend('IPDA','NN')
ylabel('v_x')
title('RMSE v_x v_y 10 Runs')
subplot(2,1,2)
plot(run10xyvi(:,1), run10xyvi(:,3),'-xk'),grid;
hold on
plot(run10xyv(:,1), run10xyv(:,3),'--ok');
legend('IPDA','NN')
ylabel('v_y')
xlabel('Time (k)')
